<h2><?=tr('Players')?></h2>
<?
	$users = fgsUsers::get();

	$table = new htmlTable();
	$table->setHeader('id', array(
		'title' => '#',
		'width' => '5ex',
	));
	$table->setHeader('login', array(
		'title' => tr('Login'),
		'width' => '12ex',
	));
	$table->setHeader('url', array(
		'title' => tr('Website'),
	));
	$table->setHeader('dt', array(
		'title' => tr('Last login'),
		'width' => '24ex',
	));
	$table->setHeader('dta', array(
		'title' => tr('Last activity'),
		'width' => '24ex',
	));

	foreach ($users as $k => $user) {
		if ($user['is_deleted'])
			$table->setLineParam('class', 'deleted');
		$table->set('id', $user['id']);
		$table->set('login', fgsBase::linkPage($user['login'], 'player', array($user['login'])));
		if (!empty($user['url']))
			$table->set('url', sprintf('<a href="%s">%s</a>', $user['url'], $user['url']));
		else
			$table->set('url', '-');
		$table->set('dt', fgsUtils::formatDate($user['dt_lastlogin']));
		$table->set('dta', fgsUtils::formatDate($user['dt_lastactivity']));
		$table->push();
	}
	
	echo $table->render();
?>
